<?php

function substitlang($texte){
		global $lang, $reptpl;

		if(! file_exists(realpath(dirname(__FILE__)) . "/../../$reptpl/lang/" .  $lang . ".php"))
        	return $texte;

        if (! empty($GLOBALS['dicotpl'])) {

    		$cle = array_keys($GLOBALS['dicotpl'] );
	    	$valeur = array_values($GLOBALS['dicotpl'] );

	        for($i=0;$i<count($cle);$i++)
	           $cle[$i]="::" . $cle[$i] . "::";

	   		$texte = str_replace($cle, $valeur, $texte);
    	}

		return $texte;
}

?>